Array.prototype.filter = function(fn){
	let newArr = []; 

	for(let item of this){
		if(fn(item)) newArr.push(item)
	}

	return newArr;
}
console.log([1,2,3,4,5,6,7,8,9].filter((x)=>x>6))